import request from '@/config/axios'

// 飘窗图片 VO
export interface ImgblockPicVO {
  id: number // 主键
  siteId: number // 所属站点
  name: string // 名称
  linkUrl: string // url
  linkLogoUrl: string // logo图片的url
  sectorId: number // 板块ID
  sort: number // 排序
}

// 飘窗图片 API
export const ImgblockPicApi = {
  // 查询飘窗图片分页
  getImgblockPicPage: async (params: any) => {
    return await request.get({ url: `/cms/imgblock-pic/page`, params })
  },

  // 查询飘窗图片详情
  getImgblockPic: async (id: number) => {
    return await request.get({ url: `/cms/imgblock-pic/get?id=` + id })
  },

  // 新增飘窗图片
  createImgblockPic: async (data: ImgblockPicVO) => {
    return await request.post({ url: `/cms/imgblock-pic/create`, data })
  },

  // 修改飘窗图片
  updateImgblockPic: async (data: ImgblockPicVO) => {
    return await request.put({ url: `/cms/imgblock-pic/update`, data })
  },

  // 删除飘窗图片
  deleteImgblockPic: async (id: number) => {
    return await request.delete({ url: `/cms/imgblock-pic/delete?id=` + id })
  },

  // 导出飘窗图片 Excel
  exportImgblockPic: async (params) => {
    return await request.download({ url: `/cms/imgblock-pic/export-excel`, params })
  },
}